﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Principal;

namespace RushTracker.Core.Models
{
    public class User : IIdentity
    {
        private bool _isAuthenticated = false;

        public User()
        {
            Id = -1;
            CreationDate = DateTime.Now;
            Roles = new List<Role>();
        }

        public virtual int Id { get; set; }
        public virtual string Username { get; set; }
        public virtual string Password { get; set; }
        public virtual string Key { get; set; }
        public virtual string Email { get; set; }
        public virtual DateTime CreationDate { get; set; }
        public virtual DateTime? LastLoginDate { get; set; }
        public virtual DateTime? LastActivityDate { get; set; }
        public virtual bool IsActivated { get; set; }
        public virtual long Downloaded { get; set; }
        public virtual long Uploaded { get; set; }
        public virtual int ReputationPoints { get; set; }

        public virtual IList<Role> Roles { get; set; }

        public virtual string AuthenticationType
        {
            get { return "RTAuthType"; }
        }

        public virtual bool IsAuthenticated
        {
            get { return this._isAuthenticated; }
            set { this._isAuthenticated = value; }
        }

        public virtual string Name
        {
            get { return Id.ToString(); }
        }
    }
}
